<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var h=prompt("请输入你的身高 单位:m");
        var w=prompt("请输入你的体重 单位:kg");
        var bmi=w/h**2;
        switch(true){
            case bmi<18.5:
                document.write("太轻了");
                break;
            case bmi>=18.5&&bmi<25:
                document.write("挺正常的");
                break;
            case bmi>=25&&bmi<28:
                document.write("微胖,稍微控制一下吧");
                break;
            case bmi>=28&&bmi<=32:
                document.write("你真的很胖");
                break;
            default:
                document.write("你是真TM巨肥");
        }
    </script>
</body>
</html>